/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * msnVerCombersaciones.java
 *
 * Created on 03/09/2011, 06:30:59 PM
 */
package UI;

import java.awt.event.MouseEvent;

/**
 *
 * @author Agustin
 */
public class msnVerCombersaciones extends javax.swing.JFrame {
    
    private msnTableModelCombersaciones miTableModel;

    /** Creates new form msnVerCombersaciones */
    public msnVerCombersaciones() {
        this.miTableModel = new msnTableModelCombersaciones();
        initComponents();
        this.tblRegistros.setModel(miTableModel);
        setEventoMouseClicked();
    }
    
    private void setEventoMouseClicked() {
        
        tblRegistros.addMouseListener(new java.awt.event.MouseAdapter() {
            
            @Override
            public void mouseClicked(MouseEvent e) {
                tblContactosMouseClicked(e);
            }
        });
    }
    
    private void tblContactosMouseClicked(java.awt.event.MouseEvent evt) {
        String cadena = "";
        int row = this.tblRegistros.rowAtPoint(evt.getPoint());
        if (row >= 0 && tblRegistros.isEnabled()) {
            for (int i = 0; i < tblRegistros.getColumnCount(); i++) {
                cadena = cadena + " " + miTableModel.getValueAt(row, i).toString();
                System.out.println(cadena);
                String registro = (String) this.miTableModel.getValueAt(row, i);
                try {
                    msnVerRegsitro msnvr = new msnVerRegsitro(registro);
                    msnvr.setVisible(true);
                } catch (Exception ex) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
            }
        }
        
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblTitulo = new javax.swing.JLabel();
        lblCrearCuenta = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblRegistros = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        lblTitulo.setFont(new java.awt.Font("Tw Cen MT", 0, 48));
        lblTitulo.setText("mm@il");
        lblTitulo.setName("lblTitulo"); // NOI18N

        lblCrearCuenta.setFont(new java.awt.Font("Tahoma", 0, 18));
        lblCrearCuenta.setText("Ver Combersaciones");
        lblCrearCuenta.setName("lblCrearCuenta"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        tblRegistros.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tblRegistros.setName("tblRegistros"); // NOI18N
        jScrollPane1.setViewportView(tblRegistros);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(119, 119, 119)
                .addComponent(lblTitulo, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)
                .addGap(113, 113, 113))
            .addGroup(layout.createSequentialGroup()
                .addGap(111, 111, 111)
                .addComponent(lblCrearCuenta)
                .addContainerGap(131, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblTitulo)
                .addGap(18, 18, 18)
                .addComponent(lblCrearCuenta)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            
            public void run() {
                new msnVerCombersaciones().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblCrearCuenta;
    private javax.swing.JLabel lblTitulo;
    private javax.swing.JTable tblRegistros;
    // End of variables declaration//GEN-END:variables
}
